package com.example.demo.result;

import lombok.Data;

@Data
public class ResponseResult {
     private int code;

     private Object data;
    private String msg;
    public ResponseResult(){

    }
    public ResponseResult(int code,Object data,String msg){
this.code=code;
this.data=data;
this.msg=msg;
    }

    public ResponseResult ok(){
        return new ResponseResult(200,null,"成功");
    }
    public ResponseResult ok(Object data,String msg){
        return new ResponseResult(200,data,msg);
    }
    public  ResponseResult ok(Object data){
        return  new ResponseResult(200,data,"成功");
    }
    public ResponseResult ok(Object code,String msg,Object data){
        return new ResponseResult((Integer) code,data,msg);
    }
    public ResponseResult error(int code,String msg ){
        return new ResponseResult(code,null,msg);
    }
}
